package demo6;

public class Tect {
    public static void animal(Animal animal){
        animal.eat();
    }
    public static void run(IRun iRun){
        iRun.run();
    }
    public static void fly(IFly iFly){
        iFly.fly();
    }
    public static void swimming(ISwimming iSwimming){
        iSwimming.swimming();
    }

    public static void main(String[] args) {
        Dog dog = new Dog();
        Bird bird = new Bird();
        Fish fish = new Fish();
        Gua1 gua1 = new Gua1();
        Gua2 gua2 = new Gua2();
        animal(dog);
        animal(bird);
        animal(fish);
        run(dog);
        fly(bird);
        swimming(fish);
        run(gua1);
        swimming(gua1);
        run(gua2);
        swimming(gua2);
    }
}
